//
//  ScanSuccessController.m
//  bluetooth
//
//  Created by 周季阳 on 15/6/17.
//  Copyright (c) 2015年 switch. All rights reserved.
//

#import "ScanSuccessController.h"
#import "LeftViewController.h"
#import "RightViewController.h"
#import "UIViewAdditions.h"
#import "ScanSuccessTableViewCell.h"
#import <CoreMotion/CoreMotion.h>
#import "ActionViewController.h"
#import "AppDelegate.h"
#import "BluetoothLibary.h"
#import "WatingViewController.h"
#import "ShopViewController.h"
#import "MakeSuccessViewController.h"
#import "MaterialViewController.h"
#import "SuperWaitViewController.h"
#import "SuperQLastViewController.h"
#import "QuChuViewController.h"
@interface ScanSuccessController ()<UITableViewDataSource,UITableViewDelegate,BluetoothDelegate>
{
    NSTimer *AutoTimer;
    CMMotionManager *_manager;
    NSTimer *zTimer;
}
@property(nonatomic,retain)UITableView *zTabelView;
@property (nonatomic, assign)BOOL zIsEnd;//判断是否摇一摇结束

@end

@implementation ScanSuccessController
@synthesize zTabelView,zIsEnd,zArrayData,centralManager,discoveredPeripheral,bluetoothClient,zArrayBlue;
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
    appDelegate.isWhere = @"2";
    
    [self createrView];
    _manager = [[CMMotionManager alloc]init];
    
    _manager.accelerometerUpdateInterval=1.0/60.0;
    
    [_manager startAccelerometerUpdates];
    zIsEnd = YES;
    
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(action) name:@"action" object:nil];
    //连接成功
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(lianjie) name:@"lianjie" object:nil];
}
-(void)action{
    [self.bluetoothClient sendDataToPeripheral:[self getTestCommandData:1]];
}
//获取机器工作命令
- (NSData *)getTestCommandData:(int)type
{
    //机器启动工作
    if (type == 1) {
        Byte startWorkByte[] = {0xa5, 0x5a, 0x01, 0x01, 0x01, 0xb5, 0x5b};
        return [[NSData alloc] initWithBytes:startWorkByte length:sizeof(startWorkByte)];
    } else if (type == 2) {
        // 机器复位
        Byte resetByte[] = {0xa5, 0x5a, 0x02, 0x02, 0x02, 0xb5, 0x5b};
        return [[NSData alloc] initWithBytes:resetByte length:sizeof(resetByte)];
    }
    
    return nil;
}

/** If the connection fails for whatever reason, we need to deal with it.
 */
- (void)centralManager:(CBCentralManager *)central didFailToConnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error
{
    NSLog(@"Failed to connect to %@. (%@)", peripheral, [error localizedDescription]);
    //[self cleanup];
}


/** We've connected to the peripheral, now we need to discover the services and characteristics to find the 'transfer' characteristic.
 */
- (void)centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPeripheral *)peripheral
{
    NSLog(@"Peripheral Connected");
    
    // Stop scanning
    [self.centralManager stopScan];
    NSLog(@"Scanning stopped");
    //[self.data setLength:0];
    
    // Make sure we get the discovery callbacks
    peripheral.delegate = self;
    
    // Search only for services that match our UUID
    [peripheral discoverServices:@[[CBUUID UUIDWithString:TRANSFER_SERVICE_UUID]]];
}
//发现服务
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverServices:(NSError *)error
{
    for (CBService *service in peripheral.services) {
        NSLog(@"Discover services: %@, UUID: %@", service, service.UUID);
        //[self.services addObject:service];
        [peripheral discoverCharacteristics:nil forService:service];
    }
}
//已搜索到得Characteristics
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error:(NSError *)error
{
    if (error) {
        NSLog(@"discover characteristics error:%@", [error localizedDescription]);
        //[self cleanup];
        return;
    }
    //be with you
    //close to me
    for (CBCharacteristic *characteristics in service.characteristics) {
        
        NSLog(@"Characteristics UUID: %@ (%@)", characteristics.UUID.data, characteristics.UUID);
        
        if ([characteristics.UUID isEqual:[CBUUID UUIDWithString:TRANSFER_WRITE_UUID]]) {
            // _writeCharacteristics = characteristics;
        }
        
        if ([characteristics.UUID isEqual:[CBUUID UUIDWithString:TRANSFER_READ_UUID]]) {
            
            [discoveredPeripheral readValueForCharacteristic:characteristics];
            [discoveredPeripheral setNotifyValue:YES forCharacteristic:characteristics];
        }
        
        // if (_bluetoothMacAddress != nil) {
        
        //mac address
        // if ([characteristics.UUID isEqual:[CBUUID UUIDWithString:TRANSFER_MAC_UUID]]) {
        
        //获取mac地址
        //                NSString *macAddress = [[NSString alloc] initWithData:characteristics.value encoding:NSUTF8StringEncoding];
        //
        //                NSLog(@"mac address: %@, characteristics value: %@", macAddress, characteristics.value);
        
        //                if (macAddress != nil && ![macAddress isEqualToString:_bluetoothMacAddress]) {
        //                    //断开连接
        //                    [self cleanup];
        //                    //重新扫描匹配设备
        //                    [self startScan:_bluetoothMacAddress isReset:NO timeoutSeconds:30.0];
        //                } else {
        //设备mac地址一致,通知调用方更新数据
        //if ([self.delegate respondsToSelector:@selector(didDiscoverPeripheral:)]) {
        //  [self.delegate didDiscoverPeripheral:_peripheral];
        // }
        //}
        // }
        //}
        
        // other characteristics
        
    }
    
}
#pragma mark - BluetoothDelegate
- (void)updateValueForPeripheral:(NSData *)data
{
    
    //superQ 14  cuk面膜机 17
    Byte value[17] = {0};
    
    
    
    [data getBytes:&value length:sizeof(value)];
    
    
    if ([[[NSUserDefaults standardUserDefaults]objectForKey:@"zhonglei"]isEqualToString:@"1"]) {
        if (value[0] == 0xa5) {
            AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
            NSLog(@"%@",appDelegate.isWhere);
            if (value[12] == 0x00) {
                NSLog(@"等待低水位信号");
            }else if (value[13] == 0x30) {
                NSLog(@"倒水");
                if ([appDelegate.isWhere isEqualToString:@"5"]) {
                    [[NSNotificationCenter defaultCenter]postNotificationName:@"cdaoshui" object:nil];
                }
                
            }else if (value[12] == 0x01) {
                NSLog(@"开始");
                if ([appDelegate.isWhere isEqualToString:@"7"]) {
                    [[NSNotificationCenter defaultCenter]postNotificationName:@"ckaishi" object:nil];
                }
                
            }else if (value[13] == 0x00) {
                if ([appDelegate.isWhere isEqualToString:@"8"]) {
                    [[NSNotificationCenter defaultCenter]postNotificationName:@"ctanchu" object:nil];
                }
                NSLog(@"结束，面膜弹出");
            }
            else if (value[12] > 0x04 && value[9]<= 0x09) {
                NSLog(@"排液，跳转到最后一个页面");
                if ([appDelegate.isWhere isEqualToString:@"11"]) {
                    [[NSNotificationCenter defaultCenter]postNotificationName:@"wancheng" object:nil];
                }
            }else if (value[12] > 0x0a){
                if ([appDelegate.isWhere isEqualToString:@"12"]) {
                    [[NSNotificationCenter defaultCenter]postNotificationName:@"quchu" object:nil];
                }
            }
            
            NSData *recData = [[NSData alloc] initWithBytes:value length:sizeof(value)];
            NSLog(@"receiveData: %@", recData);
            //                if ([self.delegate respondsToSelector:@selector(updateValueForPeripheral:)]) {
            //                    [self.delegate updateValueForPeripheral:recData];
            //
            //                }
        }

    }else{
    if (value[0] == 0xa5) {
        AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
        NSLog(@"%@",appDelegate.isWhere);
        if (value[9] == 0x00) {
            NSLog(@"等待低水位信号");
        }else if (value[9] == 0x01) {
            NSLog(@"检测到低水位信号，等待高水位信号");
            if ([appDelegate.isWhere isEqualToString:@"7"]) {
                [[NSNotificationCenter defaultCenter]postNotificationName:@"openNext" object:nil];
            }
            else if ([appDelegate.isWhere isEqualToString:@"2"]){
                AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
                appDelegate.isWhere = @"8";
                MakeSuccessViewController *begin = [[MakeSuccessViewController alloc]init];
                [self.navigationController pushViewController:begin animated:YES];
            }
            
        }else if (value[9] == 0x02) {
            if ([appDelegate.isWhere isEqualToString:@"8"]) {
                [[NSNotificationCenter defaultCenter]postNotificationName:@"jiarusisu" object:nil];
            }
            else if ([appDelegate.isWhere isEqualToString:@"2"]){
                AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
                appDelegate.isWhere = @"9";
                MaterialViewController *superQ = [[MaterialViewController alloc]init];
                [self.navigationController pushViewController:superQ animated:YES];
            }
            NSLog(@"检测到低水位和高水位信号，等待放入膜片");
        }else if (value[9] == 0x03 ) {
            if ([appDelegate.isWhere isEqualToString:@"10"]) {
                [[NSNotificationCenter defaultCenter]postNotificationName:@"lengque" object:nil];
            }
            else if ([appDelegate.isWhere isEqualToString:@"2"]){
                AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
                appDelegate.isWhere = @"11";
                SuperWaitViewController *last = [[SuperWaitViewController alloc]init];
                [self.navigationController pushViewController:last animated:YES];
            }
            NSLog(@"程序运行，跳转到倒计时页面");
        }
        else if (value[9] > 0x04 && value[9]<= 0x09) {
            NSLog(@"排液，跳转到最后一个页面");
            if ([appDelegate.isWhere isEqualToString:@"11"]) {
                [[NSNotificationCenter defaultCenter]postNotificationName:@"wancheng" object:nil];
            }
            else if ([appDelegate.isWhere isEqualToString:@"2"]){
                AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
                appDelegate.isWhere = @"11";
                SuperQLastViewController  *last = [[SuperQLastViewController alloc]init];
                [self.navigationController pushViewController:last animated:YES];
            }

        }else if (value[9] > 0x0a){
            if ([appDelegate.isWhere isEqualToString:@"12"]) {
                [[NSNotificationCenter defaultCenter]postNotificationName:@"quchu" object:nil];
            }
            else if ([appDelegate.isWhere isEqualToString:@"2"]){
                AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
                appDelegate.isWhere = @"12";
                QuChuViewController *last = [[QuChuViewController alloc]init];
                [self.navigationController pushViewController:last animated:YES];
            }

        }else if (value[9] == 0x04){
            if ([appDelegate.isWhere isEqualToString:@"2"]){
                AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
                appDelegate.isWhere = @"11";
                SuperWaitViewController *last = [[SuperWaitViewController alloc]init];
                [self.navigationController pushViewController:last animated:YES];
            }
        }
        
        NSData *recData = [[NSData alloc] initWithBytes:value length:sizeof(value)];
        NSLog(@"receiveData: %@", recData);
        //                if ([self.delegate respondsToSelector:@selector(updateValueForPeripheral:)]) {
        //                    [self.delegate updateValueForPeripheral:recData];
        //
        //                }
    }
    
    }
    
    NSMutableString *recText = [[NSMutableString alloc] init];
    for (int i = 0; i < sizeof(value); i++) {
        [recText appendFormat:@"%02x ", value[i]];
    }
    [recText appendString:@"\n"];
    
    //    self.recieveText.text = recText;
    NSLog(@"%@",recText);
    
    
    return;
}

//获取外设发送的数据
- (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error
{
    if (error) {
        NSLog(@"Error updating value for charateristic %@ error :%@", characteristic.UUID, [error localizedDescription]);
        
        //error notify
        
        return;
    }
    
    if ([characteristic.UUID isEqual:[CBUUID UUIDWithString:TRANSFER_READ_UUID]]) {
        
        //过滤数据包
        if (characteristic.value.length > 0) {
            Byte value[14] = {0};
            [characteristic.value getBytes:&value length:sizeof(value)];
            
            if (value[0] == 0xa5) {
                AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
                NSLog(@"%@",appDelegate.isWhere);
                if (value[9] == 0x00) {
                    if ([appDelegate.isWhere isEqualToString:@"2"]) {
                        AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
                        appDelegate.isWhere = @"3";
                        ActionViewController *deblocking = [[ActionViewController alloc]init];
                        [self.navigationController pushViewController:deblocking animated:YES];
                    }
                    NSLog(@"等待低水位信号");
                }else if (value[9] == 0x01) {
                    NSLog(@"检测到低水位信号，等待高水位信号");
                }else if (value[9] == 0x02) {
                    NSLog(@"检测到低水位和高水位信号，等待放入膜片");
                }else if (value[9] == 0x03) {
                    NSLog(@"程序运行，跳转到倒计时页面");
                }else if (value[9] == 0x04) {
                    NSLog(@"程序运行，跳转到倒计时页面");
                }else if (value[9] > 0x04) {
                    NSLog(@"排液，跳转到最后一个页面");
                }
                
                NSData *recData = [[NSData alloc] initWithBytes:value length:sizeof(value)];
                NSLog(@"receiveData: %@", recData);
                //                if ([self.delegate respondsToSelector:@selector(updateValueForPeripheral:)]) {
                //                    [self.delegate updateValueForPeripheral:recData];
                //
                //                }
            }
        }
        
    } else if ([characteristic.UUID isEqual:[CBUUID UUIDWithString:TRANSFER_NOTIFY_UUID]]) {
        
        //        if ([self.delegate respondsToSelector:@selector(updateValueForPeripheral:)]) {
        //            [self.delegate updateValueForPeripheral:characteristic.value];
        //        }
    }
    
    // other peripheral data
    
}

//中心读取外设实时数据
- (void)peripheral:(CBPeripheral *)peripheral didUpdateNotificationStateForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error
{
    if (error) {
        NSLog(@"Error changing notification state: %@", [error localizedDescription]);
    }
    
    // Notification has started
    if (characteristic.isNotifying) {
        [peripheral readValueForCharacteristic:characteristic];
    } else {
        // Notification has stopped, so disconnect from the peripheral
        [self.centralManager cancelPeripheralConnection:peripheral];
        
    }
}

//用于检测中心向外设写数据是否成功
- (void)peripheral:(CBPeripheral *)peripheral didWriteValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error
{
    if (error) {
        NSLog(@"Write Error: %@", error.userInfo);
    } else {
        NSLog(@"Write Success.");
    }
}

#pragma mark - initUI
-(void)createrView{
//    UIImageView * imgView = [[UIImageView alloc]init];
//    [imgView setFrame:[UIScreen mainScreen].bounds];
//    [self.view addSubview:imgView];
//    imgView.userInteractionEnabled = YES;
    
    
    
    [self initNav];
    self.view.backgroundColor = [self colorWithHexString:@"#F1F1F1"];
    
    navTitle.text = @"个人中心";
    [navRightBtn setTitle:@"首页" forState:UIControlStateNormal];
    navRightBtn.frame = CGRectMake(SCREEN_WIDTH-42 , 20, 32, SCREEN_WIDTH*0.2-20);
    navRightBtn.hidden = NO;
    
    //[navBtn setImage:[UIImage imageNamed:@"制作完成_03"] forState:UIControlStateNormal];
    [navBtn setImage:nil forState:UIControlStateNormal];
    [navBtn setTitle:@"上一步" forState:UIControlStateNormal];
    navBtn.frame = CGRectMake(10, 30, 63, 21);
    
//    UIButton *leftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
//    leftBtn.frame = CGRectMake(10, 40, 78, 26);
//    [leftBtn setBackgroundImage:[UIImage imageNamed:@"15清洗-清洁导流槽_03(1)"] forState:UIControlStateNormal];
//    [leftBtn addTarget:self action:@selector(clickLeftBtn) forControlEvents:UIControlEventTouchUpInside];
//    [imgView addSubview:leftBtn];
//    
//    UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
//    rightBtn.frame = CGRectMake(SCREEN_WIDTH-88, 40, 78, 26);
//    [rightBtn setBackgroundImage:[UIImage imageNamed:@"请放蜗牛或水_03"] forState:UIControlStateNormal];
//    [rightBtn addTarget:self action:@selector(clickRightBtn) forControlEvents:UIControlEventTouchUpInside];
//    [imgView addSubview:rightBtn];
    
    UIImageView *topImageView = [[UIImageView alloc]initWithFrame:CGRectMake((SCREEN_WIDTH-287)/2, navView.bottom+20, 287, 212)];
    topImageView.image = [UIImage imageNamed:@"扫描结果_03"];
    [self.view addSubview:topImageView];
    
    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, topImageView.bottom+5, SCREEN_WIDTH, 20)];
    label.text = @"摇一摇重新搜索";
    label.font = [UIFont boldSystemFontOfSize:14];
    label.textAlignment = NSTextAlignmentCenter;
    label.backgroundColor = [UIColor clearColor];
    label.textColor = [self colorWithHexString:@"#D45556"];
    [self.view addSubview:label];
    
    
    zTabelView = [[UITableView alloc] initWithFrame:CGRectMake(0,topImageView.bottom+40, SCREEN_WIDTH, SCREEN_HEIGHT/2)];
    zTabelView.backgroundColor = [UIColor clearColor];
    zTabelView.separatorStyle = UITableViewCellSeparatorStyleNone;
    zTabelView.delegate = self;
    zTabelView.dataSource = self;
    zTabelView.bounces = NO;
    [self.view addSubview:zTabelView];
}


-(void)autoChange

{
    //NSLog(@"%.2f --%.2f --%.2f",_manager.accelerometerData.acceleration.x,_manager.accelerometerData.acceleration.y,_manager.accelerometerData.acceleration.z);
    //根据自己需求调节x y z
    
    if (fabs(_manager.accelerometerData.acceleration.x) > 1.6 || fabs(_manager.accelerometerData.acceleration.y) > 1.8 || fabs(_manager.accelerometerData.acceleration.z) > 2.1)
        
    {
        
        NSLog(@"我晃动了 。。。。。");
        if (zIsEnd == NO) {
            
        }else{
            
            
            zTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(pree) userInfo:nil repeats:NO];
        }
        
    }
    
}
#pragma mark - 摇一摇结束
-(void)pree{
    zIsEnd = YES;
    [self lateTo];
    
}
-(void)lateTo{
    [[NSNotificationCenter defaultCenter]postNotificationName:@"jianting" object:nil];
    [self.navigationController popViewControllerAnimated:YES];
}
#pragma mark - UitableView delegate
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return [zArrayData count];
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 40;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    ScanSuccessTableViewCell *cell = [[ScanSuccessTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
    
    cell.zTitle.text = [zArrayData objectAtIndex:indexPath.row];
    
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    cell.backgroundColor = [UIColor clearColor];
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    //判断连接面膜机的种类
    //暂时把i<2改成i<1
    if ([[zArrayData objectAtIndex:indexPath.row]isEqualToString:@"C-UK面膜机"]) {
        for (int i = 0; i < 1; i++) {
            CBPeripheral *discoveredPeripheral1;
            discoveredPeripheral1 = [zArrayBlue objectAtIndex:i];
            //if ([[discoveredPeripheral1.identifier UUIDString] isEqualToString:@"A5EB7516-1A9C-874A-B152-BF9ACE7F4AD3"]) {
                [self.bluetoothClient connectPeripheral:discoveredPeripheral1];
                bluetoothClient.delegate =self;
            //}
        }
        [[NSUserDefaults standardUserDefaults]setObject:@"1" forKey:@"zhonglei"];//面膜机
    }else{
        for (int i = 0; i < 1; i++) {
            CBPeripheral *discoveredPeripheral1;
            discoveredPeripheral1 = [zArrayBlue objectAtIndex:i];
            //if ([[discoveredPeripheral1.identifier UUIDString] isEqualToString:@"03CB8AE4-113E-4411-F4DA-6C220C7E0540i"]) {
                [self.bluetoothClient connectPeripheral:discoveredPeripheral1];
                bluetoothClient.delegate =self;
            //}
        }
        
        [[NSUserDefaults standardUserDefaults]setObject:@"0" forKey:@"zhonglei"];//superQ
    }
    
}
-(void)lianjie{
    ActionViewController *deblocking = [[ActionViewController alloc]init];
    [self.navigationController pushViewController:deblocking animated:YES];
}
#pragma mark - 点击返回上一步
-(void)clickLeftBtn{
//    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
//    appDelegate.isWhere = @"1";
//    [self.navigationController popViewControllerAnimated:YES];
    ShopViewController *shop  = [[ShopViewController alloc]init];
    [self.navigationController pushViewController:shop animated:YES];
}
-(void)clickRightBtn{
    //进入面膜机
//    [[NSUserDefaults standardUserDefaults]setObject:@"1" forKey:@"zhonglei"];
//    
//    ActionViewController *deblocking = [[ActionViewController alloc]init];
//    [self.navigationController pushViewController:deblocking animated:YES];
    
    //[self.navigationController popViewControllerAnimated:YES];
    
    
    [[NSUserDefaults standardUserDefaults]setObject:@"0" forKey:@"zhonglei"];
    
    ActionViewController *deblocking = [[ActionViewController alloc]init];
    [self.navigationController pushViewController:deblocking animated:YES];
}
-(void)clickBackBtn{
    [self.navigationController popViewControllerAnimated:YES];
}
#pragma mark -
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)viewDidDisappear:(BOOL)animated{
    [AutoTimer invalidate];
    AutoTimer = nil;
    [zTimer invalidate];
    AutoTimer = nil;
}
-(void)viewWillAppear:(BOOL)animated{
    //1.0/60.0
    AutoTimer = [NSTimer scheduledTimerWithTimeInterval:1.0/60.0 target:self selector:@selector(autoChange) userInfo:nil repeats:YES];
    
}
/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
